package result

type SuccessResponse struct {
	Code uint32      `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type ErrorResponse struct {
	Code uint32 `json:"code"`
	Msg  string `json:"msg"`
}

func NewSuccessResponse(data interface{}) *SuccessResponse {
	return &SuccessResponse{0, "OK", data}
}

func NewErrorResponse(code uint32, msg string) *ErrorResponse {
	return &ErrorResponse{
		Code: code,
		Msg:  msg,
	}
}
